﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp
{
    public delegate int Calculation();
    public delegate void FinishHandler();

    class Mathematics
    {
        public Calculation Multiply;
        public event FinishHandler Finish;

        public int NumOne { get; set; }
        public int NumTwo { get; set; }

        public int Addition()
        {
            int total = NumOne + NumTwo;
            Console.WriteLine("Addition = {0}", total);

            if (Finish != null)
                Finish();

            return total;
        }

        public int Subtraction()
        {
            int sub = NumOne - NumTwo;
            Console.WriteLine("Subtraction = {0}", sub);

            return sub;
        }
    }
}
